Skip to content

autosharding: implementation of EndpointMap, autosharding client and LB Policy - #13039

Open
shivaspeaks wants to merge 58 commits into
grpc:masterfrom
shivaspeaks:autosharding-part3-lazy-endpoints
Open

shivaspeaks wants to merge 58 commits into
grpc:masterfrom
shivaspeaks:autosharding-part3-lazy-endpoints

Conversation

@shivaspeaks

@shivaspeaks shivaspeaks commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

@shivaspeaks
shivaspeaks marked this pull request as ready for review September 8, 2026 09:49
@shivaspeaks
shivaspeaks requested a review from sauravzg September 8, 2026 09:49
@shivaspeaks

Copy link
Copy Markdown
Member Author

I've added the LB policy that consumes it (AutoShardingLoadBalancer) and the AutoshardingClient it depends on, so every expectation on EndpointMap is now visible at a call site.

Note for updates in EndpointMap:

  1. Index is now list position, not a stored field.
  2. Index assigned after de-duplication.
  3. Rebuild in place instead of a fresh map: every grpc-java LB retains children by key. This is what makes the rebuilding flag necessary: LazyLoadBalancer publishes IDLE synchronously from acceptResolvedAddresses, so without it the LB would build a picker from a half-rebuilt map.
  4. The picker snapshot is built here, not in the picker.
  5. requestConnection returns early unless IDLE, where the gRFC calls ExitIdle() unconditionally.
  6. AutoShardingAttributes.ATTR_ENDPOINT_HOSTNAME and XdsInternalAttributes.ATTR_ADDRESS_NAME (gRFC A81) carry the same value but are two different keys. We need to bridge them when we do xds integration or we can refactor it out in util, we simply cannot let autosharding have a dependency on xds because then it will be cycle when we do xds integration.

@shivaspeaks

Copy link
Copy Markdown
Member Author

I will re-request for your review after I do my final review. Please wait for the re-request @sauravzg before taking a look.

@shivaspeaks shivaspeaks changed the title autosharding: implementation of EndpointMap autosharding: implementation of EndpointMap, autosharding client and LB Policy Sep 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants